package com.ruoyi.backend.service.impl.orderManagementImpl;

import com.ruoyi.backend.domain.orderManagement.Order;
import com.ruoyi.backend.mapper.orderManagement.MaintenanceOrderMapper;
import com.ruoyi.backend.service.orderManagement.IMaintenanceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 保养订单Service业务层处理
 *
 * @author 王冰冰
 * @date 2025-03-19
 */
@Service
public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
    @Autowired
    private MaintenanceOrderMapper maintenanceOrderMapper;

    /**
     * 查询保养订单
     *
     * @param orderId 保养订单主键
     * @return 保养订单
     */
    @Override
    public Order selectMaintenanceOrderByOrderId(Long orderId) {
        return maintenanceOrderMapper.selectMaintenanceOrderByOrderId(orderId);
    }

    /**
     * 查询保养订单列表
     *
     * @param order 保养订单
     * @return 保养订单
     */
    @Override
    public List<Order> selectMaintenanceOrderList(Order order) {
        return maintenanceOrderMapper.selectMaintenanceOrderList(order);
    }

    /**
     * 新增保养订单
     *
     * @param order 保养订单
     * @return 结果
     */
    @Override
    public int insertMaintenanceOrder(Order order) {
        return maintenanceOrderMapper.insertMaintenanceOrder(order);
    }

    /**
     * 修改保养订单
     *
     * @param order 保养订单
     * @return 结果
     */
    @Override
    public int updateMaintenanceOrder(Order order) {
        return maintenanceOrderMapper.updateMaintenanceOrder(order);
    }

    /**
     * 批量删除保养订单
     *
     * @param orderIds 需要删除的保养订单主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceOrderByOrderIds(Long[] orderIds) {
        return maintenanceOrderMapper.deleteMaintenanceOrderByOrderIds(orderIds);
    }

    /**
     * 删除保养订单信息
     *
     * @param orderId 保养订单主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceOrderByOrderId(Long orderId) {
        return maintenanceOrderMapper.deleteMaintenanceOrderByOrderId(orderId);
    }
}